//
//  RQTableViewCell.m
//  RQDropDownMenuDemo
//
//  Created by 蜂巢网络科技 on 2017/6/26.
//  Copyright © 2017年 fengchao. All rights reserved.
//

#import "RQDropTableViewCell.h"

#define LineColorDDDDDD [UIColor colorWithRed:221/255.0 green:221/255.0 blue:221/255.0 alpha:1]

@interface RQDropTableViewCell()
 @end

@implementation RQDropTableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.textLabel.textAlignment = NSTextAlignmentCenter;
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    
    }
    return self;
}

+ (instancetype)cellWithTableView:(UITableView *)tableView
{

    RQDropTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:dropTabelCellID];
    if (cell == nil) {
        cell = [[RQDropTableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:dropTabelCellID];
    }
    return cell;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.textLabel.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
}

- (void)drawRect:(CGRect)rect{
    
    // 下划线的绘制
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetStrokeColorWithColor(context,LineColorDDDDDD.CGColor);
    CGContextStrokeRect(context, CGRectMake(0, rect.size.height, rect.size.width, 0.5));
}

@end
